﻿Public MustInherit Class DungeonPieceObj

    Public Property Width As Integer
    Public Property Height As Integer
    Public Property Orientation As eOrientation
    Public Property TriggerEvent As Boolean
    Public Property IsObjectiveRoom As Boolean
    Public Property DivideDungeon As Boolean

    Public Overridable Function GetFloor(ByVal x As Integer, ByVal y As Integer, ByVal orientation As eOrientation, ByVal reverseDirectionFlag As Boolean, ByRef dungeonDisplay As Dungeon) As List(Of DungeonFloorObj)
        Dim cells As New List(Of DungeonFloorObj)

        Dim xIncrementer As Integer = If(reverseDirectionFlag, -20, 20)
        Dim yIncrementer As Integer = If(reverseDirectionFlag, -20, 20)

        Dim currentX As Integer = x
        Dim currentY As Integer = y

        For i As Integer = 1 To Me.Height

            For j As Integer = 1 To Me.Width

                cells.Add(New DungeonFloorObj(currentX, currentY, (j = 1), (j = Me.Width), (i = Me.Height), (i = 1)))
                currentX += xIncrementer

            Next

            currentX -= (Me.Width * xIncrementer) 'unwind
            currentY -= yIncrementer

        Next

        Return cells

    End Function

    Public Enum eOrientation
        Vertical
        Horizontal
    End Enum

End Class
